﻿using QuestDbService.IService;
using Microsoft.Extensions.Logging;
using Msung.Core.Extensions;
using Msung.Repository.Entity;
using Msung.Repository.IRepository;

namespace QuestDbService.Service
{
    public class MainService : IMainService
    {
        private readonly ILogger<MainService> _logger;
        private readonly ITestRepository _testRepository;
        public MainService(
            ILogger<MainService> logger,
            ITestRepository testRepository
            )
        {
            _logger = logger;
            _testRepository = testRepository;
            Exacute();
        }
        public void Exacute()
        {
            Test test = new Test()
            {
                Id=0,
                Name="TEST0",
                Time = DateTime.Now,
                Log = "TEST LOG"
            };
            _testRepository.Insert(test);
            _logger.logInfo("Quest db data log.");
        }
    }
}
